package cn.com.headfree.vo.simple;

import cn.com.headfree.entity.TPartRank;
import cn.com.headfree.util.SysDictionaryUtil;
import com.deepoove.poi.data.DocxRenderData;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang.StringUtils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class PatentInfoVo {

    private static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    /**
     * 名称
     */
    private String patentName;
    /**
     * 专利号
     */
    private String patentNo;
    /**
     * 类型
     */
    private String patentType;
    /**
     * 专利申请日
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date applyDate;

    private String applyDateStr;

    /**
     * 授权公告日
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date declDate;

    private String declDateStr;

    /**
     * 发明人（专利权人）
     */
    private String inventor;
    /**
     * 创建者id
     */
    private String createrId;
    /**
     * 创建者姓名
     */
    private String createrName;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createTime;
    /**
     * 更新者id
     */
    private String updaterId;
    /**
     * 更新者姓名
     */
    private String updaterName;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date updateTime;
    /**
     * 0:未删除1：已删除
     */
    private Integer delSign;
    /**
     * 是否有效数据(0:有效，1:无效)
     */
    private Integer isValid;
    /**
     * 审核状态
     */
    private Integer auditState;

    private String role;

    private String erpNo;

    private String userName;

    private Integer rank;

    private String id;

    private DocxRenderData patentPersonEx;

    private List<TPartRank> persons;

    public List<TPartRank> getPersons() {
        return persons;
    }

    public void setPersons(List<TPartRank> persons) {
        this.persons = persons;
    }

    public DocxRenderData getPatentPersonEx() {
        return patentPersonEx;
    }

    public void setPatentPersonEx(DocxRenderData patentPersonEx) {
        this.patentPersonEx = patentPersonEx;
    }

    public String getApplyDateStr() {
        return applyDateStr;
    }

    public void setApplyDateStr(String applyDateStr) {
        if (StringUtils.isNotBlank(applyDateStr)) {
            this.applyDateStr = applyDateStr.split(" ")[0];
        } else {
            this.applyDateStr = applyDateStr;
        }
    }

    public String getDeclDateStr() {
        return declDateStr;
    }

    public void setDeclDateStr(String declDateStr) {
        if (StringUtils.isNotBlank(declDateStr)) {
            this.declDateStr = declDateStr.split(" ")[0];
        } else {
            this.declDateStr = declDateStr;
        }
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPatentName() {
        return patentName;
    }

    public void setPatentName(String patentName) {
        this.patentName = patentName;
    }

    public String getPatentNo() {
        return patentNo;
    }

    public void setPatentNo(String patentNo) {
        this.patentNo = patentNo;
    }

    public String getPatentType() {
        return patentType;
    }

    public void setPatentType(String patentType) {
        this.patentType = patentType;
//        this.patentType = SysDictionaryUtil.getNameByValue("AcademicDegree",patentType);;
    }

    public Date getApplyDate() {
        return applyDate;
    }

    public void setApplyDate(Date applyDate) {
        this.applyDate = applyDate;
        if (applyDate!=null){
            this.applyDateStr=sdf.format(applyDate).split(" ")[0];
        }
    }

    public Date getDeclDate() {
        return declDate;
    }

    public void setDeclDate(Date declDate) {
        this.declDate = declDate;
        if (declDate!=null){
            this.declDateStr=sdf.format(declDate).split(" ")[0];
        }
    }

    public String getInventor() {
        return inventor;
    }

    public void setInventor(String inventor) {
        this.inventor = inventor;
    }

    public String getCreaterId() {
        return createrId;
    }

    public void setCreaterId(String createrId) {
        this.createrId = createrId;
    }

    public String getCreaterName() {
        return createrName;
    }

    public void setCreaterName(String createrName) {
        this.createrName = createrName;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdaterId() {
        return updaterId;
    }

    public void setUpdaterId(String updaterId) {
        this.updaterId = updaterId;
    }

    public String getUpdaterName() {
        return updaterName;
    }

    public void setUpdaterName(String updaterName) {
        this.updaterName = updaterName;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Integer getDelSign() {
        return delSign;
    }

    public void setDelSign(Integer delSign) {
        this.delSign = delSign;
    }

    public Integer getIsValid() {
        return isValid;
    }

    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }

    public Integer getAuditState() {
        return auditState;
    }

    public void setAuditState(Integer auditState) {
        this.auditState = auditState;
    }

    public String getRole() {
        return role;
    }

    public void setRole(String role) {
        this.role = role;
    }

    public String getErpNo() {
        return erpNo;
    }

    public void setErpNo(String erpNo) {
        this.erpNo = erpNo;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Integer getRank() {
        return rank;
    }

    public void setRank(Integer rank) {
        this.rank = rank;
    }
}
